#!/usr/bin/perl 
do 'config.pl';

eval {

   # the directory to dissect pass it in from the command line or default to '.'
    $directory = $raw;
    $tmp       = $dissect . "/";

    # loop through the directory looking for zip archives
    # When we find one extract it to the $tmp dir
    opendir( DIR, $directory )
      || die "Could not open $directory for reading: $!";
    my @files = readdir(DIR);
    closedir(DIR);

    foreach my $file (@files) {
        next unless $file =~ /\.zip/gi;
        print "unzipping $file ... \n";
        `unzip -o '$directory/$file' -d $tmp`;
    }
  }
